package com.traceability.trace.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traceability.trace.mapper.FarmerProducerMapper;
import com.traceability.trace.domain.FarmerProducer;
import com.traceability.trace.service.IFarmerProducerService;

/**
 * 农户Service业务层处理
 * 
 * @author xulin
 * @date 2025-01-09
 */
@Service
public class FarmerProducerServiceImpl implements IFarmerProducerService 
{
    @Autowired
    private FarmerProducerMapper farmerProducerMapper;

    /**
     * 查询农户
     * 
     * @param producerId 农户主键
     * @return 农户
     */
    @Override
    public FarmerProducer selectFarmerProducerByProducerId(Long producerId)
    {
        return farmerProducerMapper.selectFarmerProducerByProducerId(producerId);
    }

    /**
     * 查询农户列表
     * 
     * @param farmerProducer 农户
     * @return 农户
     */
    @Override
    public List<FarmerProducer> selectFarmerProducerList(FarmerProducer farmerProducer)
    {
        return farmerProducerMapper.selectFarmerProducerList(farmerProducer);
    }

    /**
     * 新增农户
     * 
     * @param farmerProducer 农户
     * @return 结果
     */
    @Override
    public int insertFarmerProducer(FarmerProducer farmerProducer)
    {
        return farmerProducerMapper.insertFarmerProducer(farmerProducer);
    }

    /**
     * 修改农户
     * 
     * @param farmerProducer 农户
     * @return 结果
     */
    @Override
    public int updateFarmerProducer(FarmerProducer farmerProducer)
    {
        return farmerProducerMapper.updateFarmerProducer(farmerProducer);
    }

    /**
     * 批量删除农户
     * 
     * @param producerIds 需要删除的农户主键
     * @return 结果
     */
    @Override
    public int deleteFarmerProducerByProducerIds(Long[] producerIds)
    {
        return farmerProducerMapper.deleteFarmerProducerByProducerIds(producerIds);
    }

    /**
     * 删除农户信息
     * 
     * @param producerId 农户主键
     * @return 结果
     */
    @Override
    public int deleteFarmerProducerByProducerId(Long producerId)
    {
        return farmerProducerMapper.deleteFarmerProducerByProducerId(producerId);
    }
}
